package com.spsy.order.controller;

import com.alibaba.fastjson2.JSON;
import com.spsy.common.core.domain.R;
import com.spsy.order.param.req.OrderReq;
import com.spsy.order.service.OrderOptsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: liuzhiping
 * @date: 2025/1/15 14:49
 **/
@RestController
@RequestMapping("/order")
@Slf4j
public class OrderOptsController {


    @Autowired
    private OrderOptsService orderOptsService;


    /***
     * 返回二维码给用户
     *  {@link OrderReq } 订单请求参数对象
     * @return
     */
    @RequestMapping("/doOrder")
    public R createOrder(@RequestBody OrderReq orderReq){
        System.out.println("========doOrder 下单开始 orderId="+ JSON.toJSONString(orderReq));

        R r = orderOptsService.execOrder(orderReq);

        return r;
    }





}
